package fjut.acm.coding.service.Impl;

import fjut.acm.coding.entity.SystemInfo;
import fjut.acm.coding.mapper.SystemInfoMapper;
import fjut.acm.coding.service.SystemInfoService;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import javax.annotation.Resource;

@Service
public class SystemInfoServiceImpl implements SystemInfoService {
    @Resource
    SystemInfoMapper systemInfoMapper;


    @Override
    public int insert(SystemInfo systemInfo) {

        return systemInfoMapper.insertSelective(systemInfo);
    }

    @Override
    public Integer update(SystemInfo systemInfo) {

        return systemInfoMapper.updateByPrimaryKeySelective(systemInfo);
    }

    @Override
    public SystemInfo selectOne(String name) {
        Example example = new Example(SystemInfo.class);
        example.createCriteria().andEqualTo("name", name);
        return systemInfoMapper.selectOneByExample(example);
    }
}
